/*
 */
package ImportDataFromPhone;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author ash
 */
public class Categorizer {
    
    private static CatMap c = new CatMap();
    private Container<ProcessedRecord> input;
    private Container<CategorizedRecord> output;
    
    private Categorizer (Container<ProcessedRecord> in){
        input = in;
        output = new Container<>(CategorizedRecord.class);
    }
    
    static Container<CategorizedRecord> categorize(Container<ProcessedRecord> records){
        Categorizer cato = new Categorizer(records);
        cato.categorize();
        return cato.output;
    }

    private void categorize(){

        for (int i=0; i<input.size(); i++){
            output.add(new CategorizedRecord(input.get(i), c.getCat(input.get(i).getName())));
       }
    }
   
}
